set CC=cl
set CFLAGS=/DWIN32 /I.. /I..\goo /I..\fofi /I..\splash /I..\xpdf /I..\freetype-2.4.6 /I..\freetype-2.4.6\include /I..\lpng166 /O2 /nologo
set CXX=cl
set CXXFLAGS=%CFLAGS% /TP
set LIBPROG=lib
set LINKFLAGS=/MT /nologo

copy aconf-win32.h aconf.h

cd goo

cd ..\fofi

cd ..\splash

%CXX% %CXXFLAGS% /c SplashBitmap.cc

%LIBPROG% /nologo /out:splash.lib Splash.obj SplashBitmap.obj SplashClip.obj SplashFTFont.obj SplashFTFontEngine.obj SplashFTFontFile.obj SplashFont.obj SplashFontEngine.obj SplashFontFile.obj SplashFontFileID.obj SplashPath.obj SplashPattern.obj SplashScreen.obj SplashState.obj SplashT1Font.obj SplashT1FontEngine.obj SplashT1FontFile.obj SplashXPath.obj SplashXPathScanner.obj


cd ..\xpdf




rem --- Comment out this line, and uncomment the other pdftops build line
rem     (see below) to build pdftops with the Splash rasterizer.
rem     You'll also need to define HAVE_SPLASH in aconf-win32.h.

cd ..

rem --- This part will only work if you have FreeType installed ---

set FT2DIR=..\freetype-2.4.6
set CXXFLAGS=%CXXFLAGS% /I%FT2DIR%\include

cd xpdf


%CXX% %CXXFLAGS% /c PSOutputDev.cc
%CXX% %CXXFLAGS% /c SplashOutputDev.cc
%LIBPROG% /nologo /out:libxpdf.lib Array.obj Annot.obj BuiltinFont.obj BuiltinFontTables.obj CMap.obj Catalog.obj CharCodeToUnicode.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj PDFDoc.obj PDFDocEncoding.obj PSOutputDev.obj PSTokenizer.obj Page.obj Parser.obj Stream.obj UnicodeMap.obj UnicodeTypeTable.obj XRef.obj  SecurityHandler.obj  OptionalContent.obj   PreScanOutputDev.obj
 

cd ..\src

%CXX% %CXXFLAGS% /c HtmlOutPutDev.cc
%CXX% %CXXFLAGS% /c HtmlFonts.cc

%CXX% %CXXFLAGS% /c pdftohtml2.cc
%CXX% %LINKFLAGS% /Fepdftohtml.exe HtmlFonts.obj HtmlLinks.obj HtmlOutputDev.obj  pdftohtml2.obj ..\goo\Goo.lib ..\fofi\fofi.lib ..\splash\splash.lib ..\xpdf\libxpdf.lib   ADVAPI32.LIB  ..\lpng166\libpng.lib ..\lpng166\zlib.lib ..\xpdf\SplashOutputDev.obj %FT2DIR%\freetype2.lib


cd ..
copy src\pdftohtml.exe bin\ /y
